]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shell-global: don't warn when unsetting non-existent state
authorCosimo Cecchi <cosimo@endlessm.com>
Sun, 26 May 2019 17:24:25 +0000 (10:24 -0700)
committerCosimo Cecchi <cosimo@endlessm.com>
Mon, 27 May 2019 15:36:17 +0000 (08:36 -0700)
If the state we're trying to delete does not exist, do not log an
error.
Prevents this journal warning at startup:

gnome-shell[1082]: Could not delete runtime/persistent state file: Error removing file /run/user/1000/gnome-shell/runtime-state-LE.:0/screenShield.locked: No such file or directory

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/555

src/shell-global.c

index e696a324c8d218b4931cdd9d986e32e8ac440854..293053d0b58446125b27db9848a10bf8509ede46 100644 (file)
@@ -1560,7 +1560,8 @@ delete_variant_cb (GObject      *object,
 
   if (!g_file_delete_finish (G_FILE (object), result, &error))
     {
-      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
+      if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) &&
+          !g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_FOUND))
         {
           g_warning ("Could not delete runtime/persistent state file: %s\n",
                      error->message);